#include <motor.h>

#define LEDpin 2
#define pwmApin 3
#define Ain2pin 4
#define Ain1pin 5
#define SBYpin 6
#define Bin1pin 7
#define Bin2pin 8
#define pwmBpin 9
#define demoApin 3
#define demoDpin 17

motor motorA;
motor motorB;
int cmd = 0;


void setup() {
  
  motorA.begin(SBYpin, Ain1pin, Ain2pin, pwmApin);  // (SBYpin, IN1pin, IN2pin, PWMpin)
  motorB.begin(SBYpin, Bin1pin, Bin2pin, pwmBpin);
  Serial.begin(115200);
  
}

void loop() {
  
  if (Serial.available()) {
    char inChar = Serial.read();
    if (inChar == '+') {
      cmd = cmd + 25;
    } else if (inChar == '-') {
      cmd = cmd - 25;
    }
    motorA.command(cmd);
    motorB.command(cmd);
    Serial.print("Command = ");
    Serial.println(cmd);
  }
}


